import { useEffect, useRef } from 'react'

// 首次挂载时调用
export const useEnter = (callback: () => void) => {
  const isMounted = useRef(false)

  useEffect(() => {
    if (!isMounted.current) {
      callback()
      isMounted.current = true
    }
  })
}
